package data_structure;

public class leetcode_0222 {
    public int countNodes(TreeNode root) {
        return num(root);
    }
    public int num(TreeNode node){
        if(node==null) return 0;
        return num(node.left)+num(node.right)+1;
    }
}
